<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Db;
use think\Route;

Route::rule('/:m/:mpid/:themeid/:fromuid/:do', 'mobile/:do/:do');
Route::rule('/payment/wechat/notify', 'mobile/payment/notify');
Route::rule('/payment/wechat/pay', 'mobile/payment/pay');
Route::get('oa/getdata', 'mobile/oa.getdata/index');
Route::rule('/W3.5.2/:m/:i/:do', 'wxapp/:do/:do');
Route::rule('/login', 'wxapp/entry/oauth');


//return [
//    '__pattern__' => [
//        'name' => '\w+',
//    ]
//];


# 重写规则  放置宝塔站点PHP配置文件root下方，约第7行；
//location ~* ^/app/(index|00rewrite|00wxapp)\.php {
//    rewrite ^/app/ /mobile/$arg_do/ last;
//    }
//    location = /login.php {
//    rewrite ^/login.php /web/Login/home last;
//    }
//    location ~* ^/(.*)/ {
//    try_files $uri $uri/ /index.php?s=$uri&$query_string;
//    }
//    location = /web/index.php {
//    if ($arg_c = site) {
//        rewrite ^/web/index\.php$ /web/$arg_do/$arg_do last;
//        }
//
//    if ($arg_c = account) {
//        set $redirect_to_third 1;
//        }
//    if ($arg_do = switch) {
//    set $redirect_to_third 1$redirect_to_third;
//    }
//    if ($redirect_to_third = 1) {
//        return 302 /web/index.php?c=account&a=display&do=switch&uniacid=2&type=1;
//        }
//    if ($redirect_to_third = 11) {
//        return 302 /web/index.php?c=home&a=welcome;
//    }
//
//    if ($arg_c = home) {
//        rewrite ^/web/index\.php$ /web/login/route last;
//        }
//    if ($arg_c = '') {
//        return 302 /login.php?referer=%2Fweb%2Findex.php;
//        }
//
//    # 如果不满足重定向条件，则继续处理 PHP 请求
//    try_files $uri =404;
//        fastcgi_pass unix:/var/run/php5.6-fpm.sock; # 根据您的 PHP-FPM 5.6 配置修改
//        fastcgi_index index.php;
//        include fastcgi_params;
//        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
//    }
